package com.luojialong.exception;

import com.luojialong.enums.AffairStatus;

/**
 * 全局事务异常
 * @author 罗家龙
 */
public class AffairException extends RuntimeException{
    private static final long serialVersionUID = -3611939088562553081L;

    private String description;

    private Integer code;

    private AffairStatus affairStatus;


    public AffairException(String message,int code,String description) {
        super(message);
        this.code = code;
        this.description = description;
    }

    public AffairException(AffairStatus affairStatus,String description) {
        super(affairStatus.getText());
        this.affairStatus = affairStatus;
        this.description = description;
        this.code = affairStatus.getCode();
    }




    public String getDescription() {
        return description;
    }

    public Integer getCode() {
        return code;
    }

    public AffairStatus getAffairStatus() {
        return affairStatus;
    }
}
